<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderEconomizesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_economizes', function (Blueprint $table) {
            $table->id()->comment('订单优惠金额表');
            $table->integer('order_id')->index()->comment('订单ID');
            $table->integer('user_id')->index()->comment('用户ID');
            $table->string('order_type',20)->index()->comment('配送方式： onLine : 线上订单 ，offLine : 线下订单');
            $table->decimal('pay_price',8,2)->comment('实际支付金额(分)');
            $table->decimal('postage_price',8,2)->comment('邮费优惠金额(分)');
            $table->decimal('member_price',8,2)->comment('会员优惠金额(分)');
            $table->decimal('offline_price',8,2)->comment('线下优惠金额(分)');
            $table->decimal('coupon_price',8,2)->comment('优惠券优惠金额(分)');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_economizes');
    }
}
